package com.newcoder.community.dao;

import com.newcoder.community.pojo.Message;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface MessageMapper {
    //查询当前用户的会话列表,针对每个会话返回一条最新的私信selectConversations(),支持分页
   public List<Message> selectConversations(int userId,int offset,int limit);

    //  查询当前用户会话数量selectConversationCount
    public int selectConversationCount(int userId);

    //查询某个会话包含的私信列表selectLetters
    public List<Message> selectLetters(String conversationId,int offset,int limit);

    //查询某个会话包含的私信数量selectLetterCount
    public int selectLetterCount(String conversationId);

    //查询未读私信数量selectLettersUnreadCount
    public int selectLettersUnreadCount(int userId,String conversationId);

    //发送私信
    public int insertMessage(Message message);

    //更改雄消息状态
    public  int updateStatus(int id,int status);


}
